<?php
/**
 * This is Lil's core configuration file.
 *
 * Don not modify this file directly. Override or set your configuration directives in 
 * APP/config/config.php.
 *
 * @copyright     Copyright 2008-2010, LilCake.net
 * @link          http://lilcake.net LilCake.net
 * @package       lil
 * @subpackage    lil.config
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
	Configure::write('Lil.useAdminLayout', true);
	
	Configure::write('Lil.languages', array('eng'));

	Configure::write('Lil.tablePrefix', '');
	
	Configure::write('Lil.userAssociation', array(
		'className'             => 'Lil.User',
		'foreignKey'            => 'user_id',
		'associationForeignKey' => 'area_id',
	));

	Configure::write('Lil.userDisplayField', 'name');
	Configure::write('Lil.userAdminField',   'admin');
	
	Configure::write('Lil.areaSlugField',    'slug');
	Configure::write('Lil.areaDisplayField', 'name');
	
	Configure::write('Lil.areasTable',       'areas');
	Configure::write('Lil.usersTable',       'users');
	Configure::write('Lil.areasUsersTable',  'areas_users');
	
	Configure::write('Lil.allowUsersAnything', false);
	
	Configure::write('Lil.areaSlug', 'auto'); // auto, manual
	
	// ability to disable areas table
	Configure::write('Lil.noAreas', false);
	
	// ability select default area when no area is selected
	Configure::write('Lil.defaultArea', false);
	
	// plugins should be set prior to thic config inclusion
	// so we can include plugin configs
	/*$plugins = App::objects('plugin');

	foreach($plugins as $plugin){
		App::import(App::pluginPath($plugin).'config'.DS.'bootstrap.php');
	}*/
	if ($plugins = Configure::read('Lil.plugins')) {
		if (!$plugin_path = Configure::read('Lil.pluginPath')) {
			$plugin_path = APP . 'plugins' . DS;
		}
		foreach ($plugins as $plugin) {
			$plugin_config = $plugin_path . Inflector::underscore('Lil' . $plugin) . DS . 'config' . DS . 'core.php';
			if (file_exists($plugin_config)) {
				include $plugin_config;
			}
		}
	} else {
		Configure::write('Lil.plugins', array());
	}
?>